package reflect;

import java.lang.reflect.Method;

/**
 * 调用有参数的方法
 */
public class ReflectDemo5 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Object obj = cls.newInstance();
        Method method = cls.getMethod("say",String.class);
        method.invoke(obj,"我是你地情人，像玫瑰花一样的女人");

        Method method1 = cls.getMethod("say",String.class,int.class);
        method1.invoke(obj,"我真的栓Q",10);
    }
}
